<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
	<title>客户标签</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
	<link href="../../vendors/iconfonts/mdi/css/materialdesignicons.min.css" type="text/css" rel="stylesheet"/>
	<link href="../../vendors/css/vendor.bundle.base.css" type="text/css" rel="stylesheet"/>
	<link href="../../css/style.css" type="text/css" rel="stylesheet"/>
	<link href="../../node_modules/jqvmap/dist/jqvmap.min.css" type="text/css" rel="stylesheet"/>

	<script src="../../vendors/js/vendor.bundle.base.js"></script>
	<script src="../../vendors/js/vendor.bundle.addons.js"></script>
	<script src="../../vendors/js/Calendar.js"></script>
	<script src="../../js/off-canvas.js"></script>
	<script src="../../js/misc.js"></script>

</head>

<body>


<section>

	<div id="u19955" class="ax_default" data-left="39" data-top="19" data-width="167" data-height="16">

		<!-- Unnamed (Rectangle) -->
		<div id="u19956" class="ax_default label">
			<div id="u19956_div" class="">

			</div>

			<div id="u19956_text" class="text ">

				<p class="col-sm-6 col-md-4 col-lg-3">
					<i class="mdi mdi-home"></i>
					<span style="text-decoration:none;color:#333333;">首页/客户档案管理</span><span style="text-decoration:none;">/客户标签</span></p>
			</div>
		</div>
	</div>

	<div class="box2">

		<p style="font-size:18px;"><span style="font-family:'FontAwesome';font-weight:400;text-decoration:none;"></span><span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:12px;text-decoration:none;"> </span><span style="font-family:'微软雅黑';font-weight:400;font-size:12px;text-decoration:none;">数据列表</span></p>

	</div>

	<div id="u19876" class="ax_default _默认样式">
		<div id="u19876_div" class="">

		</div>
		<div id="u19876_text" class="text " style="display:none; visibility: hidden">
			<p></p>
		</div>
	</div>
	<div class="col-lg-12 stretch-card">
		<div class="card">
			<div class="card-body" style="padding-top: 0px">

				<table class="table table-bordered" >
					<thead>
					<tr>


						<th>
							标签名称
						</th>
						<th>
							自动打标签条件
						</th>
						<th>
							备注
						</th>
						<th>
							操作
						</th>

					</tr>
					</thead>
					<tbody >
					<tr th:each="user:${queryLebalList}" class="table-info">

						<td th:text="${user.lebalName}"></td>
						<td th:text="${user.labalFactor}"></td>
						<td th:text="${user.remarks}"></td>
						<td >
                            <span><a href="javascript:;" class="userDel" th:onclick="'del(this)'" th:attr="userid=${user.userId }">
                            删除</a></span>
						</td>

					</tr>
					</tbody>
				</table>

				<!--<div>-->
						<!--<input name="lebal" id="lebal" type="text" value=""/>-->



				<!--</div>-->
			</div>
		</div>
	</div>

	<div class="page-bar">
	<ul class="page-num-ul clearfix">
	<li>共<span th:text="${page.totalCount }"></span>条记录&nbsp;&nbsp; <span th:text="${page.pageIndex}"></span>/<span th:text="${page.totalPageCount}"></span> 页</li>
	<button th:onclick="'javascript:pageQry(document.forms[0],1)'" th:if="${page.pageIndex gt 1 }">首页</button>
	<button th:onclick="'javascript:pageQry(document.forms[0],'+${page.pageIndex - 1}+')'"  th:if="${page.pageIndex gt 1 }">上一页</button>

	<button th:onclick="'javascript:pageQry(document.forms[0],'+${page.pageIndex + 1}+')'" th:if="${page.pageIndex lt page.totalPageCount}">下一页</button>
	<button th:onclick="'javascript:pageQry(document.forms[0],'+${page.totalPageCount}+')'" th:if="${page.pageIndex lt page.totalPageCount}">最后一页</button>
	&nbsp;&nbsp;
	</ul>
	<span class="page-go-form"><label>跳转至</label>
	<input type="hidden" id="totalPageCount" th:value="${page.totalPageCount}"/>
	<input type="text" name="inputPage" id="inputPage" class="page-key"/>页
	<button type="button" class="page-btn"
	th:onClick="'jumpPage(document.forms[0],document.getElementById(\''+inputPage+'\').value)'">GO</button>
	</span>
	</div>

	<script type="text/javascript" th:src="@{/js/jquery-1.8.3.min.js}"></script>
	<script type="text/javascript" th:src="@{/layer/layer.js}"></script>

	<script type="text/javascript">

		//01.分页查询
		function pageQry(form, pageIndex) {

			$.ajax({
				type:"post",
				url:"/zjs/qryPageLebal?currentPageNo="+pageIndex+"",
				data:"page=1",
				success: function(){
					window.location.href = "/zjs/qryPageLebal?currentPageNo="+pageIndex;
					// $("#Conframe").load("/zjs/qryPageLebal?currentPageNo="+pageIndex+"");


				},
				error:function () {
					alert("错误");


				}
			})

		}

		//02.跳转页查询
		function jumpPage(form, jumpPageIndex) {
			//01.数字校验
			var reg = /^[1-9]\d{0,}$/;
			if (!reg.test(parseInt(jumpPageIndex))) {
				alert("请输入合法的数字");
				return;
			}
			//02.范围校验：当前页不能大于总页数
			if (jumpPageIndex > document.getElementById("totalPageCount").value) {
				alert("已经是最后一页!");
				return;
			}
			$.ajax({
				type:"post",
				url:"/zjs/qryPageLebal?currentPageNo="+jumpPageIndex+"",
				data:"page=1",
				success: function(){
					window.location.href = "/zjs/qryPageLebal?currentPageNo="+jumpPageIndex;
					// $("#Conframe").load("/zjs/qryPageLebal?currentPageNo="+jumpPageIndex+"");


				},
				error:function () {
					alert("错误");


				}
			})
		}


		//删除用户
		function del(ele) {
			var $ele = $(ele);
			var userId = $ele.attr('userId');

			$.ajax({
				url: '/zjs/delLebal/'+userId+"",
				type: 'get',
				data: "",
				dataType: 'json',
				success: function (data) {
					alert("删除成功");

					if (data.success) {

						//页面删除行
						$("#" + userId + "_row").parent().remove();
						window.location.href = "/zjs/qryPageLebal?currentPageNo=1";
						// $("#Conframe").load("/zjs/qryPageLebal?currentPageNo=1");
					} else {

						alert("删除失败");
					}
				}

			});
		}
		// function udp(ele) {
		// 	var $ele = $(ele);
		// 	var userId = $ele.attr('userId');
		// 	$.ajax({
		// 		url:'/zjs/udpLable',
		// 		type:'get',
		// 		data:{"userId":userId,
		// 		"lebal":lebal
		// },
		// 		datatype:"json",
		// 		success:function () {
		//
		// 		},
		// 		error:function () {
		//
		// 		}
		// 	})
		//
		// }




	</script>
</section>
</body>
</html>